package com.example.dell.fastshopping.order;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;

/**
 * Created by ${YSH} on 2019/5/16.
 * 描述        ${TODO}
 * <p>
 * 更新者       $author$
 * 更新时间     $Data$
 * 描述         ${TODO}
 */
public class OrderInfo implements Serializable {
    private List<OrderInfo> list;

    public void setList(List<OrderInfo> list) {
        this.list = list;
    }

    public List<OrderInfo> getList() {
        return list;
    }


    //订单信息

    private int id;
    private String phone;
    private String orderAddress;
    private int status; //订单状态 0：发货 1：未发货 2：代付款

    private String userName;
    private long createTime;
    private String logisticsCompany;
    private String logisticsNo;
    private String orderId;//订单id
    private int productId;//商品id
    private long sendTime;
    private int intauctionClassId;//场次id
    private BigDecimal totalPrice;
    private int userId;
    private long outTime;//付款倒计时
    private String pic;//商品图片
    private List<String> picArray;//商品图片
    private String productName;
    private int payType;//支付方式 1：余额支付 2：支付宝支付，3 微信支付，4银联支付
    private long payTime;

    public void setId(int id) {
        this.id = id;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public void setOrderAddress(String orderAddress) {
        this.orderAddress = orderAddress;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public void setLogisticsCompany(String logisticsCompany) {
        this.logisticsCompany = logisticsCompany;
    }

    public void setLogisticsNo(String logisticsNo) {
        this.logisticsNo = logisticsNo;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public void setProductId(int productId) {
        this.productId = productId;
    }

    public void setSendTime(long sendTime) {
        this.sendTime = sendTime;
    }

    public void setIntauctionClassId(int intauctionClassId) {
        this.intauctionClassId = intauctionClassId;
    }

    public void setTotalPrice(BigDecimal totalPrice) {
        this.totalPrice = totalPrice;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public void setOutTime(long outTime) {
        this.outTime = outTime;
    }

    public void setPic(String pic) {
        this.pic = pic;
    }

    public void setPicArray(List<String> picArray) {
        this.picArray = picArray;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public void setPayType(int payType) {
        this.payType = payType;
    }

    public void setPayTime(long payTime) {
        this.payTime = payTime;
    }

    public int getId() {
        return id;
    }

    public String getPhone() {
        return phone;
    }

    public String getOrderAddress() {
        return orderAddress;
    }

    public int getStatus() {
        return status;
    }

    public String getUserName() {
        return userName;
    }

    public long getCreateTime() {
        return createTime;
    }

    public String getLogisticsCompany() {
        return logisticsCompany;
    }

    public String getLogisticsNo() {
        return logisticsNo;
    }

    public String getOrderId() {
        return orderId;
    }

    public int getProductId() {
        return productId;
    }

    public long getSendTime() {
        return sendTime;
    }

    public int getIntauctionClassId() {
        return intauctionClassId;
    }

    public BigDecimal getTotalPrice() {
        return totalPrice;
    }

    public int getUserId() {
        return userId;
    }

    public long getOutTime() {
        return outTime;
    }

    public String getPic() {
        return pic;
    }

    public List<String> getPicArray() {
        return picArray;
    }

    public String getProductName() {
        return productName;
    }

    public int getPayType() {
        return payType;
    }

    public long getPayTime() {
        return payTime;
    }

    public String getStatusString() {
        //  status; //订单状态 0：发货 1：未发货 2：代付款
        String s = "";
        switch (status) {
            case 0:
                s = "待收货";
                break;
            case 1:
                s = "待发货";
                break;
            case 2:
                s = "待付款";
                break;
        }
        return s;
    }

    public String getPicString() {
        if (pic != null) {
            String[] split = pic.split(",");
            List<String> list = Arrays.asList(split);
            return list.size() > 0 ? list.get(0) : "";
        }
        return "";
    }

    public String getTotalPriceString() {
        if (totalPrice == null) {
            return
                    "￥0.00";
        }
        return "￥" + totalPrice.setScale(2, BigDecimal.ROUND_HALF_UP).toString();

    }
}
